<div class="container">
  <form #zhiyiForm="ngForm" (submit)="signInHandler()" class="form-signin" action="index.html">
    <h2 class="form-signin-heading">请登陆</h2>
    <label for="inputEmail" class="sr-only">Email address</label>
    <input
      type="email"
      name="email"
      id="inputEmail"
      class="form-control"
      placeholder="Email address"
      required
      [email]="true"
      [(ngModel)]="signForm.email"
      #email="ngModel"
    >
    <div *ngIf="email.invalid && (email.dirty || email.touched)" class="alert alert-danger">
      <div *ngIf="email.errors.required">
        Email is required.
      </div>
      <div *ngIf="email.errors.email">
        Invalid Email.
      </div>
    </div>
    <label for="inputPassword" class="sr-only">Password</label>
    <input
      type="password"
      id="inputPassword"
      name="password"
      class="form-control"
      placeholder="Password"
      required
      minlength="6"
      maxlength="18"
      [(ngModel)]="signForm.password"
      #password="ngModel"
    >
    <div *ngIf="password.invalid && (password.dirty || password.touched)" class="alert alert-danger">
      <div *ngIf="password.errors.required">
        Password is required.
      </div>
      <div *ngIf="password.errors.minlength">
        Password minlength 6.
      </div>
    </div>
    <div class="alert alert-danger" *ngIf="error_message">
      {{error_message}}
    </div>
    <button
      [disabled]="!zhiyiForm.form.valid"
      class="btn btn-lg btn-primary btn-block"
      type="submit">立即登陆</button>
  </form>
  <p class="info"><a routerLink="/signup" href="javascript:;">Don't have an account? Create one here.</a></p>
</div>
